export function formatPhone(phone: string): string {
  let temp = phone.replace(/\s+/g, '');
  const newPhone = [temp.slice(0, 3), temp.slice(3, 7), temp.slice(7, 11)]
    .filter(item => !!item)
    .join(' ');

  return newPhone;
}

export function replaceBlank(phone: string): string {
  return phone ? phone.replace(/\s+/g, '') : '';
}
